﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Timetable.Base.Entities;
using Timetable.Base.Interfaces.Services.DataServices;
using Timetable.Base.Interfaces.Services.DataServices.Extensions;
using Ninject;

namespace Timetable.Site.Controllers.Api
{
    public class AuditoriumController : BaseApiController<Auditorium>
    {
        /// <summary>
        /// Возвращает сведения об аудитории
        /// </summary>
        /// <param name="number">Номер аудитории</param>
        /// <param name="buildingId">Идентификатор корпуса</param>
        /// <returns>Сведения об аудитории</returns>
        public HttpResponseMessage GetByNumber(string number, int buildingId)
        {
            return CreateResponse<string, int, Auditorium>(privateGetByNumber, number, buildingId);
        }

        private Auditorium privateGetByNumber(string number, int buildingId)
        {
            return DataService.GetByNumber(number, buildingId);
        }
    }
}
